#!/bin/bash
#
# Argument 1 (the only argument to VolumeCheck) is the full path to a volume 
#   in Installer's Target Select panel that a user can choose to
#   install the software on.
# The path is of the form "/" or /Volume/{volume name}
#
# For convenience, this script echoes the path and name of each volume.
path=$1
#
# Get the volume name from the full path.
#
#path=${path##/*/}
#echo "Volume name is: $path"
#
# You can perform testing of arbitrary complexity here.
# This script just disallows installing on volumes named "Jaguar".
#
# Note: If $path were not enclosed in quotes in the next statement,
#       the script would get an error if the volume name included a space.
#
if ([ ! -d "/$path/iPod_Control" ]) then
#
# If the volume has the disallowed name, return a value that tells Installer
# not to allow installation on the volume.
# The value should also specify a string from the VolumeCheck.strings file
# to display if the user clicks the volume icon.
# 
# To do this, supply an error return value of 32.
#
# Sets the action bit (bit 5) to 1, to disallow the volume.
let retval=32
#
# Sets the message value bits (bits 0 to 4) to 16,
# specifying the message associated with "16" in the strings file.
#  
let retval=(retval+16)
#
#else
#
# The volume name is OK, so allow it as a possible destination.
#
#retval=0
fi
exit $retval
